{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from sklearn.tree import DecisionTreeClassifier\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.model_selection import cross_val_score\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Int64Index: 891 entries, 1 to 891\n",
      "Data columns (total 11 columns):\n",
      "Survived    891 non-null int64\n",
      "Pclass      891 non-null int64\n",
      "Name        891 non-null object\n",
      "Sex         891 non-null object\n",
      "Age         714 non-null float64\n",
      "SibSp       891 non-null int64\n",
      "Parch       891 non-null int64\n",
      "Ticket      891 non-null object\n",
      "Fare        891 non-null float64\n",
      "Cabin       204 non-null object\n",
      "Embarked    889 non-null object\n",
      "dtypes: float64(2), int64(4), object(5)\n",
      "memory usage: 83.5+ KB\n"
     ]
    }
   ],
   "source": [
    "data = pd.read_csv(r\"data/data.csv\",index_col = 0)\n",
    "data.head()\n",
    "data.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Survived</th>\n",
       "      <th>Pclass</th>\n",
       "      <th>Sex</th>\n",
       "      <th>Age</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Fare</th>\n",
       "      <th>Embarked</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>PassengerId</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Survived  Pclass  Sex   Age  SibSp  Parch     Fare  Embarked\n",
       "PassengerId                                                              \n",
       "1                   0       3    1  22.0      1      0   7.2500         0\n",
       "2                   1       1    0  38.0      1      0  71.2833         1\n",
       "3                   1       3    0  26.0      0      0   7.9250         0\n",
       "4                   1       1    0  35.0      1      0  53.1000         0\n",
       "5                   0       3    1  35.0      0      0   8.0500         0"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#删除缺失值过多的列，和观察判断来说和预测的y没有关系的列\n",
    "data.drop([\"Cabin\",\"Name\",\"Ticket\"],inplace=True,axis=1)\n",
    "\n",
    "#处理缺失值，对缺失值较多的列进行填补，有一些特征只确实一两个值，可以采取直接删除记录的方法\n",
    "data[\"Age\"] = data[\"Age\"].fillna(data[\"Age\"].mean())\n",
    "data = data.dropna()\n",
    "\n",
    "#将分类变量转换为数值型变量\n",
    "\n",
    "#将二分类变量转换为数值型变量\n",
    "#astype能够将一个pandas对象转换为某种类型，和apply(int(x))不同，astype可以将文本类转换为数字，用这个方式可以很便捷地将二分类特征转换为0~1\n",
    "data[\"Sex\"] = (data[\"Sex\"]== \"male\").astype(\"int\")\n",
    "\n",
    "#将三分类变量转换为数值型变量\n",
    "labels = data[\"Embarked\"].unique().tolist()\n",
    "data[\"Embarked\"] = data[\"Embarked\"].apply(lambda x: labels.index(x))\n",
    "\n",
    "#查看处理后的数据集\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = data.iloc[:,data.columns != \"Survived\"]\n",
    "y = data.iloc[:,data.columns == \"Survived\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pclass</th>\n",
       "      <th>Sex</th>\n",
       "      <th>Age</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Fare</th>\n",
       "      <th>Embarked</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>45.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>26.5500</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.4958</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>70.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>71.0000</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.7500</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>19.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.8958</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Pclass  Sex   Age  SibSp  Parch     Fare  Embarked\n",
       "0       1    1  45.0      0      0  26.5500         0\n",
       "1       3    0  18.0      0      0   7.4958         0\n",
       "2       1    1  70.0      1      1  71.0000         0\n",
       "3       3    0  16.0      0      0   7.7500         2\n",
       "4       3    1  19.0      0      0   7.8958         0"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "Xtrain, Xtest, Ytrain, Ytest = train_test_split(X,y,test_size=0.3)\n",
    "\n",
    "#修正测试集和训练集的索引\n",
    "for i in [Xtrain, Xtest, Ytrain, Ytest]:\n",
    "    i.index = range(i.shape[0])\n",
    "    \n",
    "#查看分好的训练集和测试集\n",
    "Xtrain.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.7827715355805244"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clf = DecisionTreeClassifier(random_state=25)\n",
    "clf = clf.fit(Xtrain, Ytrain)\n",
    "score_ = clf.score(Xtest, Ytest)\n",
    "\n",
    "score_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.7739274770173645"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "score = cross_val_score(clf,X,y,cv=10).mean()\n",
    "\n",
    "score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.8177860061287026\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpY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2LGSIyS1WT83rOr4x1wdqwwdZPzW6xz5kDqjb08cwzoVcvC/YmTeCoo4Ku1rlCyYPeRde6ddZSzw72efPs8cREu2jpwQct2Bs3hiOPDLZW5+KEB70rWBs2wKRJe4J90SJ7vFQp63658koL9kaNbPpf51zEedC7yNu50648HT7cltnbtQvKlLETptdfb8HesKHPBOlclHjQu8hQtQuVhg+HESOsJV+5sk0v0KkTnH66r8DkXED8N8/lT1qaXW06fDgsXGjdL5dcAtddB61aebg7FwP8t9Aduq1b4cMPLdw//9xa882aweDBNr3A0UcHXaFzLgcPeheerCyYNs3CffRoC/ukJBslc+21cOKJQVfonNsPD3p3YIsXW7i/9ZYtxlG2rK28dN111oo/wGR1zrnY4EHv9rVhA7z3ngX899/bdAOtW8PTT0OHDj6+3blCxoPemZ07Yfx4C/dPPrEhkXXrwrPPwlVX+cyPzhViHvRFmarNJZM9JHL9evjb36BHD+jaFerVC7pC51wEeNAXRWlp8M47FvALFtiQyA4dLNx9SKRzccd/o4uKrVthzBgL9ylTrDXftCn89782DYEPiXQubnnQx7OsLJtfJntI5JYtULMm9O1rQyJPOinoCp1zUeBBH68++cT62lessCGRnTvbkMimTW0UjXOuyPCgj0dvvAE33mhL6z31lA+JdK6IC6tpJyJtRGSxiKSKSK88nq8hIlNFZLaI/CQi7UKPXyAis0RkXujf8yL9BlwuAwbAP/8JLVvagh6dO3vIO1fEHTToRSQBGAi0BWoDXUSkdq7NHgBGqWoDbPHwQaHH1wMXq2pdoCvwVqQKd7moQu/ecM89dnL1k098RSbnHBBei74RkKqqy1R1JzAS6JBrGwXKhm6XA1YDqOpsVV0devxnIFFEfHWJSMvMhO7d4ckn4eab4d13fREP59xu4QR9VWBljvtpocdy6gdcIyJpwDigZx776QjMVtUduZ8Qke4ikiIiKenp6WEV7kK2b7cW/JAh8MADMGiQLaTtnHMh4QR9XrNWaa77XYBhqloNaAe8JSK79y0idYCngJvyOoCqDlbVZFVNrlSpUniVO9i8GS680KYMfv55eOQRn2TMObePc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PWpU9X/AShE5JfRQS2BBNGvIpQsBdduErAAai0ip0O9NSwI6aS8ifwv9WwO4jGC/L2OBrqHbXYGPI7HTYpHYSSwQkRFAC6CiiKQBD6nq61EuoylwLTAv1D8O0EdVx0W5jirAmyKSgP0xH6WqgQ5vDFhlYIzlCcWAd1V1QgB19ATeCXWbLAP+L4AaCPVFXwDcFMTxAVT1exEZDfyIdZXMJrhpCD4QkQrALuBWVf0jGgfNK7OAJ4FRInID9sfwiogcy6dAcM65+OZdN845F+c86J1zLs550DvnXJzzoHfOuTjnQe+cc3HOg9455+KcB71zzsW5/we+Q44NddpxLQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "tr = []\n",
    "te = []\n",
    "for i in range(10):\n",
    "    clf = DecisionTreeClassifier(random_state=25\n",
    "                                 ,max_depth=i+1\n",
    "                                 ,criterion=\"entropy\"\n",
    "                                )\n",
    "    clf = clf.fit(Xtrain, Ytrain)\n",
    "    score_tr = clf.score(Xtrain,Ytrain)\n",
    "    score_te = cross_val_score(clf,X,y,cv=10).mean()\n",
    "    tr.append(score_tr)\n",
    "    te.append(score_te)\n",
    "print(max(te))\n",
    "plt.plot(range(1,11),tr,color=\"red\",label=\"train\")\n",
    "plt.plot(range(1,11),te,color=\"blue\",label=\"test\")\n",
    "plt.xticks(range(1,11))\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8215434083601286"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "gini_thresholds = np.linspace(0,0.5,20)\n",
    "\n",
    "parameters = {'splitter':('best','random')\n",
    "              ,'criterion':(\"gini\",\"entropy\")\n",
    "              ,\"max_depth\":[*range(1,10)]\n",
    "              ,'min_samples_leaf':[*range(1,50,5)]\n",
    "              ,'min_impurity_decrease':[*np.linspace(0,0.5,20)]\n",
    "             }\n",
    "\n",
    "clf = DecisionTreeClassifier(random_state=25)\n",
    "GS = GridSearchCV(clf, parameters, cv=10)\n",
    "GS.fit(Xtrain,Ytrain)\n",
    "\n",
    "GS.best_params_\n",
    "\n",
    "GS.best_score_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
